package ink.yuanchu.picachoframework.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import ink.yuanchu.picachoframework.entity.TimedTask;
import ink.yuanchu.picachoframework.dao.TimedTaskMapper;
import ink.yuanchu.picachoframework.service.TimedTaskService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ziyuan
 * @since 2021-03-30
 */
@Service
public class TimedTaskServiceImpl extends ServiceImpl<TimedTaskMapper, TimedTask> implements TimedTaskService {

    @Autowired
    private TimedTaskMapper timedTaskMapper;

    @Override
    public TimedTask findByTaskName(String name) {
        QueryWrapper<TimedTask> wrapper = new QueryWrapper<>();
        wrapper.eq("task_name",name);
        TimedTask timedTask = timedTaskMapper.selectOne(wrapper);
        return timedTask;
    }
}
